package com.todo.member.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author azhebuxing
 * @date 2025/3/4 04:09
 * @description
 */
@Getter
@AllArgsConstructor
public enum RelationRewardEnum {

    MATERIAL(1, "MATERIAL", "实物"),
    PROPERTY(2, "PROPERTY", "权益"),
    SERVICE(3, "SERVICE", "服务"),
    GROWTH(3, "GROWTH", "成长值"),
    POINTS(3, "POINTS", "积分"),
    COUPON(3, "COUPON", "优惠券"),
    REDPACKET(3, "REDPACKET", "红包"),
    ;

    private static Map<Integer, MedalClassifyEnum> typeMap = Arrays
            .stream(MedalClassifyEnum.values())
            .collect(Collectors.toMap(MedalClassifyEnum::getType, item -> item, (v1, v2) -> v2));

    private int type;
    private String code;
    private String name;


    public static MedalClassifyEnum getByType(Integer type) {
        return typeMap.get(type);
    }
}
